package config;
import java.io.*;

import org.apache.commons.configuration.*;

public class ConfigManager {
        private static XMLConfiguration configfile;
        private static ConfigManager instance;
        
        public static boolean verbose = true;
        public static boolean debug = false;
        
        public static ConfigManager getInstance() throws ConfigurationException{
                if (instance == null)
                        instance = new ConfigManager();
                return instance;
        }
        public ConfigManager() throws ConfigurationException {
                File currentDir = new java.io.File("");
                String path = currentDir.getAbsolutePath()
                                + System.getProperty("file.separator");
                ConfigManager.configfile = new XMLConfiguration(path +"config.xml");
        }
        
        private ConfigManager(String configpath) throws ConfigurationException {
                this.configfile = new XMLConfiguration(configpath);
        }

        public String get(String key){
                return this.configfile.getString(key);
        }       
} 
